package hhh;

/**
 * @Author: fg
 * @Date: 2020/6/7 14:53
 */
public class Student {
    String name;
    boolean man;

    /**
     * 1. 方法名和类名相同
     * 2. 没有返回值,void也没有
     * 3. 不能用return返回具体的数据
     */
    public Student(){
        System.out.println("构造方法执行了嘛?");
    }

    public Student(String name,boolean man){
        this.name = name;
        this.man = man;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    // 设置值
    public void setMan(boolean man){
        this.man = man;
    }

    // 获取值
    public boolean isMan(){
        return  man;
    }

    public void sleep(){
        int a = 20;
        System.out.println(name);
        System.out.println(a);
    }

    public void eat(){
        System.out.println(name);
        // System.out.println(a);
    }
}
